// pages/work-detail/work-detail.js
var request = require('../../utils/request.js')
var config = require('../../config.js');
var modal = require('../../utils/modal.js')
Page({

  /**
   * 页面的初始数据
   */
  data: {
    no: '',
    create_time: '',
    shop_user_name: '',
    real_name: '',
    mobile: '',
    level: '',
    car_plate: '',
    company_name: '',
    original_amount: '',
    proportion: '',
    amount: ''


  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
    modal.loading()
    request.post({ path: config.insuranceDetail}, { id: options.id }).then(res => {
      modal.hide()
      that.setData({
        no: res.data.data.no,
        create_time: res.data.data.create_time,
        shop_user_name: res.data.data.shop_user_name,
        real_name: res.data.data.real_name,
        mobile: res.data.data.mobile,
        level: res.data.data.level,
        car_plate: res.data.data.car_plate,
        company_name: res.data.data.company_name,
        original_amount: res.data.data.original_amount,
        proportion: res.data.data.proportion,
        amount: res.data.data.amount
      })
    })
  },
  toHome() {
    wx.switchTab({
      url: '../index/index',
    })
  },
   
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})